#ifndef FILETRANSFERSCROLLDIALOG_H
#define FILETRANSFERSCROLLDIALOG_H
#include "../Core/msgbus_interface.h"
#include "../Core/msgbus_handlerbase.hpp"
#include <map>
#include <string>
#include <QDialog>
#include <boost/shared_ptr.hpp>
using std::string;
using std::map;
using namespace NetMsgBus;
namespace Ui {
    class FileTransferScrollDialog;
}
class FileTransferMgrDlg;

class FileTransferScrollDialog : public QDialog, public MsgHandler<FileTransferScrollDialog>
{
    Q_OBJECT

public:
    explicit FileTransferScrollDialog(QWidget *parent = 0);
    ~FileTransferScrollDialog();
    void SetWWMainUniqueId(const std::string& uniqueid);
    void CleanDataOnLogout();
    void InitMsgHandler();

signals:
    void receiveFileTransferNotify(MsgBusParam);
    void receivePicTransferFinished(MsgBusParam);
    void receiveOfflineImageNotify(MsgBusParam);
    void receiveTribeImageNotify(MsgBusParam);
    void receiveOfflineFileNotify(MsgBusParam);
    void newactivity();

public slots:
    void OnDoNotifyOtherSide(MsgBusParam);
    void OnDoOfflineNotifyOtherSide(MsgBusParam);
    void OnTransferActivity();

private:
    bool OnIMFileTransferNotify(const std::string& msgid, MsgBusParam& param, bool& is_continue);
    bool OnIMPicTransferFinished(const std::string& msgid, MsgBusParam& param, bool& is_continue);
    bool OnIMOfflineImageNotify(const std::string& msgid, MsgBusParam& param, bool& is_continue);
    bool OnIMTribeImageNotify(const std::string& msgid, MsgBusParam& param, bool& is_continue);
    bool OnIMOfflineFileNotify(const std::string& msgid, MsgBusParam& param, bool& is_continue);

    std::string m_wwmain_unique;
    Ui::FileTransferScrollDialog *ui;
    boost::shared_ptr<FileTransferMgrDlg> m_transfer_panel;
};

#endif // FILETRANSFERSCROLLDIALOG_H
